class HomeProductInfo {
  int flag;
  String buttonFlag;
  int count;
  String message;
  Data data;

  HomeProductInfo(
      {this.flag, this.buttonFlag, this.count, this.message, this.data});

  HomeProductInfo.fromJson(Map<String, dynamic> json) {
    flag = json['flag'];
    buttonFlag = json['buttonFlag'];
    count = json['count'];
    message = json['message'];
    data = json['data'] != null ? new Data.fromJson(json['data']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['flag'] = this.flag;
    data['buttonFlag'] = this.buttonFlag;
    data['count'] = this.count;
    data['message'] = this.message;
    if (this.data != null) {
      data['data'] = this.data.toJson();
    }
    return data;
  }
}

class Data {
  List<FirstProducts> firstProducts;
  List<SecondProducts> secondProducts;

  Data({this.firstProducts, this.secondProducts});

  Data.fromJson(Map<String, dynamic> json) {
    if (json['firstProducts'] != null) {
      firstProducts = new List<FirstProducts>();
      json['firstProducts'].forEach((v) {
        firstProducts.add(new FirstProducts.fromJson(v));
      });
    }
    if (json['secondProducts'] != null) {
      secondProducts = new List<SecondProducts>();
      json['secondProducts'].forEach((v) {
        secondProducts.add(new SecondProducts.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.firstProducts != null) {
      data['firstProducts'] =
          this.firstProducts.map((v) => v.toJson()).toList();
    }
    if (this.secondProducts != null) {
      data['secondProducts'] =
          this.secondProducts.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class FirstProducts {
  int key;
  int id;
  String name;
  int seq;
  String descInfo;
  Null parentId;
  StatusCode statusCode;
  String iconUrl;
  String imageUrl;

  FirstProducts(
      {this.key,
        this.id,
        this.name,
        this.seq,
        this.descInfo,
        this.parentId,
        this.statusCode,
        this.iconUrl,
        this.imageUrl});

  FirstProducts.fromJson(Map<String, dynamic> json) {
    key = json['key'];
    id = json['id'];
    name = json['name'];
    seq = json['seq'];
    descInfo = json['descInfo'];
    parentId = json['parentId'];
    statusCode = json['statusCode'] != null
        ? new StatusCode.fromJson(json['statusCode'])
        : null;
    iconUrl = json['iconUrl'];
    imageUrl = json['imageUrl'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['key'] = this.key;
    data['id'] = this.id;
    data['name'] = this.name;
    data['seq'] = this.seq;
    data['descInfo'] = this.descInfo;
    data['parentId'] = this.parentId;
    if (this.statusCode != null) {
      data['statusCode'] = this.statusCode.toJson();
    }
    data['iconUrl'] = this.iconUrl;
    data['imageUrl'] = this.imageUrl;
    return data;
  }
}

class StatusCode {
  String itemCode;
  String itemValue;
  String type;

  StatusCode({this.itemCode, this.itemValue, this.type});

  StatusCode.fromJson(Map<String, dynamic> json) {
    itemCode = json['itemCode'];
    itemValue = json['itemValue'];
    type = json['type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['itemCode'] = this.itemCode;
    data['itemValue'] = this.itemValue;
    data['type'] = this.type;
    return data;
  }
}

class SecondProducts {
  int key;
  int id;
  String name;
  Null firstName;
  int parentId;
  Null descInfo;
  StatusCode statusCode;
  int seq;
  Null campusList;
  Null isCampus;
  Null serviceAgentList;
  Null serviceAgentFlag;

  SecondProducts(
      {this.key,
        this.id,
        this.name,
        this.firstName,
        this.parentId,
        this.descInfo,
        this.statusCode,
        this.seq,
        this.campusList,
        this.isCampus,
        this.serviceAgentList,
        this.serviceAgentFlag});

  SecondProducts.fromJson(Map<String, dynamic> json) {
    key = json['key'];
    id = json['id'];
    name = json['name'];
    firstName = json['firstName'];
    parentId = json['parentId'];
    descInfo = json['descInfo'];
    statusCode = json['statusCode'] != null
        ? new StatusCode.fromJson(json['statusCode'])
        : null;
    seq = json['seq'];
    campusList = json['campusList'];
    isCampus = json['isCampus'];
    serviceAgentList = json['serviceAgentList'];
    serviceAgentFlag = json['serviceAgentFlag'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['key'] = this.key;
    data['id'] = this.id;
    data['name'] = this.name;
    data['firstName'] = this.firstName;
    data['parentId'] = this.parentId;
    data['descInfo'] = this.descInfo;
    if (this.statusCode != null) {
      data['statusCode'] = this.statusCode.toJson();
    }
    data['seq'] = this.seq;
    data['campusList'] = this.campusList;
    data['isCampus'] = this.isCampus;
    data['serviceAgentList'] = this.serviceAgentList;
    data['serviceAgentFlag'] = this.serviceAgentFlag;
    return data;
  }
}